﻿function setCookie(name, value, iDay) {
	 var expdate = new Date();   //初始化时间
	    expdate.setTime(expdate.getTime() + 30 * 60 * 1000);   //时间
	    document.cookie=name+"="+value+";expires="+expdate.toGMTString()+";path=/";
}

function getCookie(name) {
	var arr = document.cookie.split('; ');
	var i = 0;
	for (i = 0; i < arr.length; i++) {
		var arr2 = arr[i].split('=');
		if (arr2[0] == name) {
			var getC = decodeURIComponent(arr2[1]);
			return getC;
		}
	}
	return '';
}

function removeCookie(name) {
	setCookie(name, '1', -1);
}